package cn.tedu.boot01.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

@RestController
public class BMIController {
    @RequestMapping("/bmi")
    public String bmi(double height,double weight){

        double num=(weight/(height*height));
        if(num>27){
            return num+"，有点胖了";
        }else if(num>24&&num<=27){
            return num+"，微胖";
        }else if(num>18.5&&num<=24){
            return num+"，正常";
        }else {
            return num+"，偏瘦";
        }
    }
}
